<!--
 * @Descripttion: 
 * @version: 
 * @Author: wutao
 * @LastEditors: wutao
 * @LastEditTime: 2025-08-13 23:48:35
-->
<template>
  <div>
    <div class="">
      <p style="margin: 15px 0; color: #9998a9">
        {{ formatTimestamp(topList.createTime) }}
      </p>

      <div class="top-box" :class="isShadow?'boxShadow':''">
        <p>{{ topList.title }}</p>
        <div class="top-box-list" style="background: linear-gradient(180deg, rgba(8,131,241,0.028) 0%, rgba(8,131,241,0.012) 100%);border: 1px solid rgba(8,131,241,0.08);">
          <div class="top-box-list-item top-box-list-item-border">
            <div class="gzlc_box">
              <img src="../../assets/images/tzzwb_icon.png" alt="" />
              <div>摘要</div>
            </div>
            <div
              style="
                margin-bottom: 12px;
                line-height: 26px;
                text-align: justify;
                text-justify: inter-ideograph;
              "
              v-for="(topItemCard, topItemIndex) in topList.card[0].list"
              :key="'datalist-' + topItemIndex"
            >
              {{ topItemIndex + 1 }}.{{ topItemCard}}
            </div>
          </div>
        </div>
        <div
          class="top-box-btn"
          v-for="(topItemCard, Index) in topList.card"
          :key="'card-' + Index"
          @click="djseegdfxnews()"
        >
          查看午报详细内容
        </div>
        <p class="askMe">你可以尝试这样问我</p>
        <div
          @click="sendMessageBy(topItemLink)"
          v-for="(topItemLink, topItemLinkIndex) in topList.link"
          class="top-box-list-item-link"
          :key="'link-' + topItemLinkIndex"
        >
          {{ topItemLink }}
        </div>
      </div>
    </div>
  </div>
</template>
  
  <script>
import {} from "@/utils/common";
import { Toast } from "vant";
import commonFunc from "@/utils/ysjh";
export default {
  data() {
    return {
      datalist: [],
    };
  },
  props: {
    topList: {
      type: Object,
      default: () => {},
    },isShadow: {
    type: Boolean,
    default: false,
  },
  },
  watch: {},
  mounted() {
    // console.log(this.topList.card[0].list,'this.topList.cardthis.topList.card')
    // this.datalist = JSON.parse(this.topList.card[0].list);
  },
  created() {},
  methods: {
    //点击查看详情
    djseegdfxnews() {
      let openSource = this.topList.url.openSource;
      let openType = this.topList.url.openType;
      let functionCode = this.topList.url.functionCode;
      let param = this.topList.url.param;
      commonFunc.openService(openSource, openType, functionCode, param);
    },
    sendMessageBy(e) {
      this.$parent.showCollect = false;
      this.$parent.someMethod(e);
    },
    formatTimestamp(ms) {
      if (!ms) {
        return "";
      }
      const time = Number(ms);
      if (!time || isNaN(time)) return "-";
      const d = new Date(time);
      const Y = d.getFullYear();
      const M = String(d.getMonth() + 1).padStart(2, "0");
      const D = String(d.getDate()).padStart(2, "0");
      const h = String(d.getHours()).padStart(2, "0");
      const m = String(d.getMinutes()).padStart(2, "0");
      const s = String(d.getSeconds()).padStart(2, "0");
      return `${Y}-${M}-${D} ${h}:${m}:${s}`;
    },
  },
};
</script>
  
 <style lang="less" scoped>
.ztfx-span {
  opacity: 1;
  color: #666666 !important;
  font-family: PingFang SC;
  font-weight: regular;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0px;
  text-align: justified;
  background: none !important;
  font-weight: normal !important;
}
.top-box-list-item-border {
  // border-bottom: 1px solid #aecde8;
}
.top-box-list {
  padding-bottom: 1px !important;
}
.gzlc_box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 32px;
  background: url("@/assets/images/gzlc_box.png") no-repeat center center;
  background-size: 100% 100%;
  margin-top: 5px;
  font-size: 13px;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: normal;
  color: #232428;
  margin-bottom: 10px;
  img {
    width: 10px;
    height: 10px;
    margin-right: 5px;
    vertical-align: middle;
  }
}
</style>
  